package website

class Reservation {

	// basic
	Date created = new Date()
	Date arr_date // arrival date
	Date dep_date // departure date
	// Timestamp t_arrival //arrival time to the apartment (local time)
	int num_nights 
	int num_persons
	String currency // enum type to do
	String password // password for reservation for guests
	
	
	float total_price
	String payment_method // bank transfer / paypal
	String status // not confirmed / confirmed - waiting for money / payed
	// String ipadress
	 
		
	String name
	String surname
	String mail
	String phone
	String country
		
	String info // about reservation
	 		
	// additional options
	boolean supple 	  // supplement for one day reservation
	boolean ctb       // cot for a baby
	boolean late_arr  // arrival between 22.00 p.m. and 07.a.m.
	boolean trans_in  // transfer in
	boolean trans_out // transfer out	
	
	Apartment apartment
	static belongsTo = [ apartment : Apartment ]
	
    static constraints = {
		name(nullable: false,size : 3..20)
		surname(nullable: false,size: 2..20)
		mail(email: true, nullable: false)
		currency(inList : ['PLN','EUR','GBP','USD'] )
		phone(matches : "[0-9]{7,}")		
    }
}
